package changdu

import (
	"gitee.com/leo-xin/novel_distribution_sdk_go/changdu/api"
	"gitee.com/leo-xin/novel_distribution_sdk_go/changdu/config"
	"gitee.com/leo-xin/novel_distribution_sdk_go/common/middleware"
)

type Client struct {
	ApiClient *api.APIClient
}

func Init(cfg *config.Configuration) *Client {
	client := &Client{
		ApiClient: api.NewAPIClient(cfg),
	}
	if cfg.LogEnable {
		client.ApiClient.Use(middleware.LogMiddleware)
	}

	return client
}

func (c *Client) GetPackageListV2Api() *api.GetPackageListV2ApiService {
	return c.ApiClient.GetPackageListV2Api
}

func (c *Client) GetBoundPackageListV1Api() *api.GetBoundPackageListV1ApiService {
	return c.ApiClient.GetBoundPackageListV1Api
}

func (c *Client) PromotionListV1Api() *api.PromotionListV1ApiService {
	return c.ApiClient.PromotionListV1Api
}

func (c *Client) UserRechargeV1Api() *api.UserRechargeV1ApiService {
	return c.ApiClient.UserRechargeV1Api
}

func (c *Client) UserListV1Api() *api.UserListV1ApiService {
	return c.ApiClient.UserListV1Api
}
